// 报表模板设置-template-
const tableTemplateMod = (request) => {
	return {
		// 动态数据查询
		view_publiclogic_getDatas(query = {}) {
			return request('/bussiness/publiclogic/getDatas', {
				method: 'post',
				data: query,
			})
		},
		// 获取模板数据
		view_tableTemplate_id(id) {
			return request(`/bussiness/tableTemplate/${id}`, {
				method: 'get',
			})
		},
		// 预览数据获取
		view_tableTemplate_getData(query = {}) {
			return request('/bussiness/tableTemplate/getReportData', {
				// return request('/bussiness/tableTemplate/getData', {
				method: 'post',
				data: query,
			})
		},
		view_tableTemplate_page(query = {}) {
			return request('/bussiness/tableTemplate/page', {
				method: 'post',
				data: query,
			})
		},
		view_tableTemplate_add(query = {}) {
			return request('/bussiness/tableTemplate/add', {
				method: 'post',
				data: query,
			})
		},
		view_tableTemplate_edit(query = {}) {
			return request('/bussiness/tableTemplate/edit', {
				method: 'post',
				data: query,
			})
		},
		view_tableTemplate_del(query) {
			return request('/bussiness/tableTemplate/del', {
				method: 'post',
				data: {
					batchesDel: query,
				},
			})
		},
		// 获取表单结果详情
		view_formResults_getOne(query = {}) {
			return request('/bussiness/formResults/getOne', {
				method: 'post',
				data: query,
			})
		},
	}
}

// 组件配置保存表
const componentConfigurationMod = (request) => {
	return {
		// 综合查询-快速数据统计
		view_statisticalConfiguration_page(query = {}) {
			return request('/bussiness/statisticalConfiguration/page', {
				method: 'post',
				data: query,
			})
		},
		// 综合查询-新增快速数据统计
		view_statisticalConfiguration_add(query = {}) {
			return request('/bussiness/statisticalConfiguration/add', {
				method: 'post',
				data: query,
			})
		},
		// 综合查询-编辑快速数据统计
		view_statisticalConfiguration_edit(query = {}) {
			return request('/bussiness/statisticalConfiguration/edit', {
				method: 'post',
				data: query,
			})
		},
		// 综合查询-删除快速数据统计
		view_statisticalConfiguration_del(query = {}) {
			return request('/bussiness/statisticalConfiguration/del', {
				method: 'post',
				data: {
          batchesDel: query,
        },
			})
		},
		// 综合查询-详情快速数据统计
		view_statisticalConfiguration_view(id) {
			return request(`/bussiness/statisticalConfiguration/${id}`, {
				method: 'get',
			})
		},
		// 综合查询-复合组件统计
		view_statistics_query(query = {}) {
			return request('/bussiness/statistics/comprehensiveQuery', {
				method: 'post',
				data: query,
			})
		},
		// 数据集列表
		view_componentSettings_page(query = {}) {
			return request('/bussiness/componentSettings/page', {
				method: 'post',
				data: query,
			})
		},
		view_componentConfiguration_page(query = {}) {
			return request('/bussiness/componentConfiguration/page', {
				method: 'post',
				data: query,
			})
		},
		view_componentConfiguration_add(query = {}) {
			return request('/bussiness/componentConfiguration/add', {
				method: 'post',
				data: query,
			})
		},
		view_componentConfiguration_edit(query = {}) {
			return request('/bussiness/componentConfiguration/edit', {
				method: 'post',
				data: query,
			})
		},
		view_componentConfiguration_del(componentId) {
			return request('/bussiness/componentConfiguration/del', {
				method: 'post',
				data: {
					id: componentId,
				},
			})
		},
	}
}

// 任务共享-任务填报
const taskManagementMod = (request) => {
	return {
		view_taskManagement_page(query = {}) {
			return request('/datasharing/taskManagement/page', {
				method: 'post',
				data: query,
			})
		},
		view_taskManagement_add(query = {}) {
			return request('/datasharing/taskManagement/add', {
				method: 'post',
				data: query,
			})
		},
		view_taskManagement_edit(query = {}) {
			return request('/datasharing/taskManagement/edit', {
				method: 'post',
				data: query,
			})
		},
		view_taskManagement_del(query) {
			return request('/datasharing/taskManagement/del', {
				method: 'post',
				data: {
					batchesDel: query,
				},
			})
		},
	}
}

// 动态表单报表结果
const formResultsMod = (request) => {
	return {
		view_formResults_list(query = {}) {
			return request('/bussiness/formResults/list', {
				method: 'post',
				data: query,
			})
		},
		view_formResults_add(query = {}) {
			return request('/bussiness/formResults/add', {
				method: 'post',
				data: query,
			})
		},
		view_formResults_edit(query = {}) {
			return request('/bussiness/formResults/edit', {
				method: 'post',
				data: query,
			})
		},
		view_formResults_del(query) {
			return request('/bussiness/formResults/del', {
				method: 'post',
				data: {
					batchesDel: query,
				},
			})
		},
	}
}

// 表格属性条目
const tableItemMod = (request) => {
	return {
		view_tableItem_add(query = {}) {
			return request('/bussiness/tableItem/add', {
				method: 'post',
				data: query,
			})
		},
		view_tableItem_edit(query = {}) {
			return request('/bussiness/tableItem/edit', {
				method: 'post',
				data: query,
			})
		},
		view_tableItem_list(query = {}) {
			return request('/bussiness/tableItem/list', {
				method: 'post',
				data: query,
			})
		},
		view_tableItem_page(query = {}) {
			return request('/bussiness/tableItem/page', {
				method: 'post',
				data: query,
			})
		},
		view_tableItem_del(query) {
			return request('/bussiness/tableItem/del', {
				method: 'post',
				data: {
					batchesDel: query,
				},
			})
		},
	}
}

export default ({ request }: any) => ({
	...tableTemplateMod(request),
	...taskManagementMod(request),
	...componentConfigurationMod(request),
	...formResultsMod(request),
	...tableItemMod(request),
})
